#include<bits/stdc++.h>
#include<iostream>
using namespace std;

int main()
{
	int input1=0, input2=0, r=-1;
	do {
		r = -1;
		cin>>input1>>input2;
		if(input1 < 0)
		    break;
		int a = input1;
		int b = input2;
	    if(a<b)
		{
			int temp=a;
			a=b;
			b=temp;
		}
		while(r!=0)
		{
			r=a%b;
			a=b;
			b=r;
		}
		if(input2 / a == 1)
		{
			cout << input1 / a << endl;
		} 
		else
		{
			cout << input1 / a << "/" << input2 / a <<endl;
		} 
	}while(1);
	return 0;
}
